#include <cstring>
#include <iostream>
using namespace std;

/* 
    关于带有虚函数的类的对象的存储分布
 */

typedef void(*Fun)(void);

class Base {
  public:
    virtual void f() { cout << "Base::f" << endl; }

    virtual void g() { cout << "Base::g" << endl; }

    virtual void h() { cout << "Base::h" << endl; }
};


int main() {
    cout << "hello world" << endl;
    Base b;
    Fun pFun = (Fun)*( (uint64_t*) *(uint64_t *)(&b) + 2);
    (*pFun)();
    return 0;
}
